home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol112 / msutil.lbr / NMIEXIT.DOC < prev    next >
Encoding:
Text File  |  1986-12-15  |  10.9 KB  |  226 lines

  1.  
  2.       
  3.       
  4.       
  5.        
  6.        
  7.        
  8.        
  9.       TITLE:  How to Cure the Dreaded "LOCKED KEYBOARD" Condition.
  10.               An Installation and User's Guide for the NMIEXIT program.
  11.       
  12.       *************************************************************************
  13.       *************************************************************************
  14.       **                                                                     **
  15.       ** The NMIEXIT program and this documentation may be used, copied and  **
  16.       ** shared without fee under the following conditions:                  **
  17.       **                                                                     **
  18.       **  . You may not sell or distribute these materials for profit.       **
  19.       **                                                                     **
  20.       **  . These materials are provided on an "as is" basis.                **
  21.       **    No warranty is expressed or implied.                             **
  22.       **                                                                     **
  23.       **  . The author assumes no responsibility for any damages that may    **
  24.       **    occur as a result of using these materials.                      **
  25.       **                                                                     **
  26.       **                                                                     **
  27.       **  . The author will attempt to answer any written questions          **
  28.       **    concerning these materials.                                      **
  29.       **                                                                     **
  30.       **  . If you use these materials and find then useful,                 **
  31.       **    You may send a $20. contribution to:                             **
  32.       **                                                                     **
  33.       **          JACKSON SOFTWARE                                           **
  34.       **          1729 Mayflower Dr.                                         **
  35.       **          Carrollton, Tx 75007                                       **
  36.       **                                                                     **
  37.       *************************************************************************
  38.       *************************************************************************
  39.       
  40.       INTRODUCTION: 
  41.       
  42.       Ah  yes, here we are trying to debug that new program that is going to
  43.       sell a million copies and ARGGGG, the keyboard just  locked  up.  Well
  44.       its  out  there  some  where  looping  out  of  control  with  all the
  45.       interrupts turned off. If you  could  just  look  at  that  last  file
  46.       buffer,  or  examine  a key location for clues. But alas no, its power
  47.       off,  power  on,  and  start  single  stepping.  Perhaps  your  not  a
  48.       programmer,  but  have  just  purchased  a  wonderful  new  integrated
  49.       spreadsheet and calorie counting package. Each time you try to compute
  50.       the  bottom line on your dinner menu it locks up. If only Alt-Ctrl-Del
  51.       would work. 
  52.       
  53.       Well have I got good news for you. For the  price  of  a  simple  push
  54.       button  switch,  a very minor hardware modification to your IBM PC and
  55.       the NMIEXIT program, your prayers are answered. 
  56.       
  57.       
  58.       
  59.       
  60.       
  61.       
  62.       
  63.       
  64.       
  65.       
  66.       
  67.       
  68.       
  69.       
  70.       
  71.       HOW DOES IT WORK 
  72.       
  73.       The NMIEXIT program takes advantage of a  special  line  on  the  8088
  74.       called  the  Non-Maskable  Interrupt line. It is, as the name implies,
  75.       non-maskable by normal software. This line appears on the IBM  PC  bus
  76.       at  pin  A1 on every card in the IBM PC. This line is normally used by
  77.       memory boards to signal another dreaded condition, the  PARITY  CHECK.
  78.       In most other respects the NMI behaves much the same as any other 8088
  79.       interrupt. It has a vector at location 0000:0008 which normally points
  80.       to a routine in BIOS that simply prints out the dreaded "PARITY CHECK"
  81.       message and halts the machine. 
  82.       
  83.       A push button switch may be wired from pin  A1  of  any  PC  board  to
  84.       ground.  Pushing  the  switch  will  then  simulate  the  parity check
  85.       condition and the PC will go running off  to  the  BIOS  NMI  routine,
  86.       print  out  the "PARITY CHECK" message and halt. What good is that you
  87.       ask? Well not much, but that is where the NMIEXIT program  comes  into
  88.       play.  Before you invoke the program that is giving you trouble, issue
  89.       the NMIEXIT command. The command requires one operand, the name of any
  90.       DOS com type program. NMIEXIT makes itself resident along with the com
  91.       program you supplied as an argument. The  NMI  vector  is  altered  to
  92.       point to the NMIEXIT program. 
  93.       
  94.       Now you invoke your program and the keyboard locks up, simply push the
  95.       button. The NMIEXIT program gets control.  It  first  cleans  house  a
  96.       little so that the display and keyboard are usable again. Next NMIEXIT
  97.       displays all of the registers and flags as they were at the  time  the
  98.       button  was pushed. The com program that you provided as an operand to
  99.       the command is now given control.  If  that  program  happened  to  be
  100.       DEBUG.COM  you  are  now  in  fat city. Display that buffer, dump that
  101.       stack, look at those counters, and maybe you will find the clue. 
  102.       
  103.       The ability to  specify  any  DOS  com  type  program  to  NMIEXIT  is
  104.       extremely flexible. For the non-programmer we talked about earlier who
  105.       only wanted to get his machine restarted, I have provided  REBOOT.COM.
  106.       This  simple  program  simply  jumps to the restart vector. You should
  107.       never have to power off your machine again. 
  108.       
  109.       However, even this wonderful scheme has a weak spot. What if the rouge
  110.       program  wipes  out  NMIEXIT  or  the copy of DEBUG you made resident?
  111.       There is a last resort, not pleasant though. For that last resort case
  112.       I have provided CASBAS.COM. A routine that gets you to cassette BASIC.
  113.       Since cassette BASIC is in rom it can not get wiped out. Now  you  can
  114.       PEEK,  MID$  and HEX$ yourself up a little dump routine to look at the
  115.       remains of your problem program. 
  116.       
  117.       The DOS com program that you specify as  an  operand  to  the  NMIEXIT
  118.       command  must  contain  a drive identifier and a path specification if
  119.       they are other that the  default.  The  extension  COM  must  also  be
  120.       included. 
  121.       
  122.             EXAMPLE:
  123.        
  124.                NMIEXIT C:\DEBUG.COM
  125.       
  126.       Oh yes, it only runs under DOS 2.0 or 2.1. DOS 1.1 users,  upgrade.  I
  127.       do  not know if NMIEXIT will work on any IBM compatible. I have tested
  128.       it only on IBM PC and IBM PC-XT. 
  129.       
  130.       
  131.       
  132.       
  133.       
  134.       
  135.       
  136.       
  137.       NOTES ON INSTALLING THE PUSH BUTTON 
  138.       
  139.       The  installation  of the push button is a simple task for anyone with
  140.       even the most basic electrical and mechanical skills. However  if  you
  141.       have  never  had  a  soldering iron in your hands, enlist the aid of a
  142.       friend who has. 
  143.       
  144.       Here is a list of the stuff you will need: 
  145.       
  146.         A push button switch, momentary contact, SPST, normally open
  147.         A box to mount the button in
  148.         A 2 ft. length of single conductor shielded cable
  149.         A short length (several inches) of 30 or 40 GA wire
  150.         An RCA phono jack and female connector that can be mounted on the
  151.         faceplate of one of your PC boards.
  152.       
  153.       All of these items are available at any RADIO SHACK store.  Of  course
  154.       if  you are not into neatness, you can get by with only the button and
  155.       wire. 
  156.       
  157.       First mount the button in the box,  connect  the  shielded  cable  and
  158.       mount  the  male RCA phono jack to the end of the cable. If you have a
  159.       ohm meter or continuity checker of some kind, it is a  good  to  check
  160.       out the operation of the button at this time. 
  161.       
  162.       The  next  step  is  to  select which board in you PC you are going to
  163.       modify. Since the NMI signal appears on all boards it does not  really
  164.       matter  which  one you chose. However, pick one that has room to mount
  165.       the phono jack. 
  166.       
  167.       Remove the faceplate from the board, drill a hole and mount the  jack.
  168.       Reinstall the faceplate. 
  169.       
  170.       Now  lets  find  pin A1 and the ground pin on the board. Lay the board
  171.       flat on a table with the component side up and the faceplate  on  your
  172.       right.  The A1 pin will be the first pin on the right end of the board
  173.       fingers. The ground pin will  be  on  the  other  side  of  the  board
  174.       directly  opposite  the A1 pin. The plated paths will usually run from
  175.       the connector fingers to a row of circular thru connects located  just
  176.       above the fingers. Some boards will have etched labels on the board to
  177.       help you locate the pins. The circular  thru  connects  are  the  best
  178.       place  to  solder  and connect your wires. Use small gauge wire (30 or
  179.       40) and run a connection from ground to the shell or  outside  of  the
  180.       phono  jack.  Run  the  other  connection  from  pin  A1 to the center
  181.       terminal on the phono jack. Use solder sparingly on the board. 
  182.       
  183.       
  184.       
  185.       
  186.       
  187.       
  188.       
  189.       
  190.       
  191.       
  192.       
  193.       
  194.       
  195.       
  196.       
  197.       
  198.       
  199.       
  200.       
  201.       
  202.       
  203.       CHECKING IT OUT 
  204.       
  205.       Re-install the board and put everything back together. Do not plug  in
  206.       your  button  yet.  Power  up  the  system  and  watch for smoke (just
  207.       kidding). The machine should power up cleanly. If  you  get  a  PARITY
  208.       CHECK  error  you  have  shorted  the  NMI  lead  (pin  A1)  to ground
  209.       somewhere. Now plug in your button. If you get  a  PARITY  CHECK  then
  210.       there is a short somewhere in the cable or plug. Assuming all is still
  211.       well and your system is up and running,  now  press  the  button.  You
  212.       should  get  a PARITY CHECK message and your system will lock up. This
  213.       confirms that your button is doing what it is suppose to. Now re-power
  214.       the  system  and  invoke  NMIEXIT  specifying DEBUG.COM as an operand.
  215.       Remember to include  any  drive  and  path  identifiers  if  required.
  216.       NMIEXIT will give a confirmation message if all went well. Now hit the
  217.       button. The screen will clear and NMIEXIT will display  the  registers
  218.       and  flags  at the time the button was hit. At this time you should be
  219.       in DEBUG. Try some of your favorite DEBUG commands. Entering the DEBUG
  220.       "Q" command should return you to DOS. 
  221.       
  222.       HAPPY HUNTING. 
  223. END OF TRANSFER - PRESS ENTER TO RETURN TO MENU
  224.      "Q" command should return you to DOS. 
  225.       
  226.